<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>doh.robot DnD Test</title>

	<style>
		@import "../../../../util/doh/robot/robot.css";
	</style>

	<!-- required: dojo.js -->
	<script type="text/javascript" src="../../../../dojo/dojo.js"
		djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("dijit.robotx");

		dojo.addOnLoad(function(){
			var container1;
			var container2;
			var container3;
			var container4;
			var container5;

			doh.robot.initRobot('../test_dnd.html');

			doh.register('dojox.robot.AutoGeneratedTestGroup',{
				name: 'autotest0',
				timeout: 10000,
				setUp: function(){
					container1=dojo.byId('container1');
					container2=dojo.query("div[jsid='c2']")[0];
					container3=dojo.query("div[jsid='c3']")[0];
					container4=dojo.query("div[jsid='c4']")[0];
					container5=dojo.query("div[jsid='c5']")[0];
				},
				runTest: function(){
					var count1=dojo.query("div", container1).length;
					var count2=dojo.query("div", container2).length;
					var d = new doh.Deferred();
					doh.robot.mouseMoveAt('dojoUnique13', 500, 500, 10, 10);
					doh.robot.mousePress({left:true}, 100);
					doh.robot.mouseMoveAt(container2, 100, 1000);
					doh.robot.mouseRelease({left:true}, 500);
					doh.robot.sequence(d.getTestCallback(function(){
						var actual = dojo.query("> div", container1).length;
						count1--;
						doh.is(count1, actual, "Wrong number of items ("+actual+") in container 1 (expected " + count1 + ")");
						var actual = dojo.query("> div", container2).length;
						count2++;
						doh.is(count2, actual, "Wrong number of items ("+actual+") in container 2 (expected " + count2 + ")");
					}), 1000);
					return d;
				}
			});
			doh.register('dojox.robot.AutoGeneratedTestGroup',{
				name: 'autotest1',
				timeout: 10000,
				runTest: function(){
					var count1=dojo.query("> div", container1).length;
					var count2=dojo.query("> div", container2).length;
					var d = new doh.Deferred();
					doh.robot.mouseMoveAt('dojoUnique3', 500, 500, 10, 10);
					doh.robot.mousePress({left:true}, 500);
					doh.robot.mouseMoveAt(container1, 500, 1000);
					doh.robot.mouseRelease({left:true}, 500);
					doh.robot.sequence(d.getTestCallback(function(){
						var actual = dojo.query("> div", container1).length;
						count1++;
						doh.is(count1, actual, "Wrong number of items ("+actual+") in container 1 (expected " + count1 + ")");
						var actual = dojo.query("> div", container2).length;
						doh.is(count2, actual, "Wrong number of items ("+actual+") in container 2 (expected " + count2 + ")");
					}), 1000);
					return d;
				}
			});
			doh.register('dojox.robot.AutoGeneratedTestGroup',{
				name: 'autotest2',
				timeout: 10000,
				runTest: function(){
					var count2=dojo.query("> div", container2).length;
					var count5=dojo.query("> div", container5).length;
					var d = new doh.Deferred();
					doh.robot.mouseMoveAt('dojoUnique11', 500, 500, 10, 10);
					doh.robot.mousePress({left:true}, 500);
					doh.robot.mouseMoveAt(container2, 500, 1000);
					doh.robot.mouseRelease({left:true}, 500);
					doh.robot.sequence(d.getTestCallback(function(){
						var actual = dojo.query("> div", container2).length;
						doh.is(count2, actual, "Wrong number of items ("+actual+") in container 2 (expected " + count2 + ")");
						var actual = dojo.query("> div", container5).length;
						doh.is(count5, actual, "Wrong number of items ("+actual+") in container 5 (expected " + count5 + ")");
					}), 1000);
					return d;
				}
			});
			doh.run();
		});
	</script>
</head>
</html>
